//用户接口相关的函数
import request from '../utils/requset'

//获取商品列表
export const cateList = (params) => {
    return request.get('/goods/catelist', { params })
}

//修改分类
export const editcate = (data) => {
    return request.post('/goods/editcate', data)
}

//删除商品分类
export const goodsDel = (params) => {
    return request.get('/goods/delcate', { params })
}

//添加分类
export const addcate = (data) => {
    return request.post('/goods/addcate', data)
}

//获取所有启用的分类
export const categories =()=>{
    return request.get('/goods/categories')
}

//商品图片上传
export const uploadImg = (data)=>{
    return request.post('/goods/goods_img_upload',data)
}

//添加商品接口
export const goodsAdd = (data)=>{
    return request.post('/goods/add',data)
}

//获取商品列表
export const goodsList = (params)=>{
    return request.get('/goods/list',{params})
}

//修改商品
export const goodsEdit = (data)=>{
    return request.post('/goods/edit',data)
}
//删除商品
export const goodsDelet = (params)=>{
    return request.get('/goods/del',{params})
}